package Num1;

public class Solution {
    public int missingNumber(int[] nums) {
        int ans=0;
        for (int x : nums) {
            ans ^= x;
        }
        int n = nums.length;
        for (int i = 0; i <= n; ++i) {
            ans ^= i;
        }
        return ans;
    }


    public static void main(String[] args) {
        Solution array=new Solution();
        int[] arr={0,1,2,3,5};
        System.out.println(array.missingNumber(arr));


    }
}
